//+build sentry

package sentry

import (
	"gitee.com/ant180/dlog"
	"github.com/getsentry/raven-go"
	"os"
)

// SentryUsing 使用go build -tags 控制使用使用Sentry.
const SentryUsing = true

var SentryDSN = ""

func init() {
	SentryDSN = os.Getenv("SENTRY_DSN")
	if SentryDSN == "" {
		dlog.Error("sentry dsn empty, %s", SentryDSN)
		return
	}
	err := raven.SetDSN(SentryDSN)
	if err != nil {
		dlog.Error("sentry SetDSN fail, %s %v", SentryDSN, err)
	}
}
